execute as @e[type=item_frame,tag=electric_button] at @s unless block ~ ~-1 ~ black_glazed_terracotta unless block ~ ~-1 ~ white_glazed_terracotta run kill @s
execute as @e[type=item_frame,tag=electric_button] at @s run data modify entity @s Item set value {id:"blue_terracotta",Count:1b,tag:{display:{Name:'{"text":"RIGHT CLICK","italic": false,"color": "yellow"}'}}}
execute as @e[type=item_frame,tag=electric_button] if score @s eb_last matches 1.. at @s run tag @s add hasPower
execute as @e[type=item_frame,tag=electric_button] unless score @s eb_last matches 1.. at @s run tag @s remove hasPower
execute as @e[type=item_frame,tag=electric_button,nbt={ItemRotation:1b},tag=!hasPower] at @s run scoreboard players set @s eb_last 20
execute as @e[type=item_frame,tag=electric_button,nbt={ItemRotation:1b}] at @s run data modify entity @s ItemRotation set value 0b
execute as @e[type=item_frame,tag=electric_button,tag=hasPower] at @s run setblock ~ ~-1 ~ white_glazed_terracotta
execute as @e[type=item_frame,tag=electric_button,tag=!hasPower] at @s run setblock ~ ~-1 ~ black_glazed_terracotta
execute as @e[type=item_frame,tag=electric_button] if score @s eb_last matches 1.. run scoreboard players remove @s eb_last 1